package cn.explink.distributor.framework.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * 是否启用
 *
 * @author firefly 2015-2-28 10:40
 *
 */
public enum ConditionTypeEnum {

	Matchable(1, "可匹配的"), Comparable(2, "可比较的");

	private int value;
	private String text;

	private ConditionTypeEnum(int value, String text) {
		this.value = value;
		this.text = text;
	}

	public int getValue() {
		return this.value;
	}

	public String getText() {
		return this.text;
	}

	public static List<ConditionTypeEnum> getAllStatus() {
		List<ConditionTypeEnum> conditionTypeEnumList = new ArrayList<ConditionTypeEnum>();
		conditionTypeEnumList.add(Matchable);
		conditionTypeEnumList.add(Comparable);
		return conditionTypeEnumList;
	}

	public static String getTextByValue(int value) {
		List<ConditionTypeEnum> allStatus = ConditionTypeEnum.getAllStatus();
		for (ConditionTypeEnum conditionTypeEnum : allStatus) {
			if (conditionTypeEnum.getValue() == value) {
				return conditionTypeEnum.getText();
			}
		}
		return "";
	}
}
